unit EntradaSearchFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  ExtCtrls, Buttons, StdCtrls, DBGrids, EditBtn, MainSearchFr;

type

  { TEntradaSearchFrame }

  TEntradaSearchFrame = class(TMainSearchFrame)
    BitBtn1: TBitBtn;
    data_emissao: TDateEdit;
    id_fornecedor: TEdit;
    Label5: TLabel;
    numero_nf: TEdit;
    code: TEdit;
    id_entrada: TEdit;
    nome_pessoa: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    procedure BitBtn1Click(Sender: TObject);
    procedure LocalizarButtonClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses Initializator, MainFr, EntradaDM, QueryConditions;

{ TEntradaSearchFrame }

procedure TEntradaSearchFrame.LocalizarButtonClick(Sender: TObject);
var
  condicoes: TQueryConditions;
begin
  condicoes.AddJoinField('e.id_fornecedor','p.id_pessoa');
  condicoes.Add('e.id_entrada', id_entrada.Text);
  condicoes.Add('e.id_fornecedor', id_fornecedor.Text);
  condicoes.Add('e.data_emissao', data_emissao.Text);
  condicoes.Add('e.numero_nf', numero_nf.Text);
  condicoes.AddText('p.nome_pessoa', nome_pessoa.Text);
  condicoes.Add('e.code', code.Text);
  EntradaData.Search(Condicoes, 'entrada as e, pessoa as p');
end;

procedure TEntradaSearchFrame.BitBtn1Click(Sender: TObject);
begin
  TheControl.ShowForeignFrame(TMainFrame(FornecedorSearchFrame));
end;

initialization
  {$I entradasearchfr.lrs}

end.

